package com.atguigu.gulimall.ware.dao;

import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 商品库存
 *
 * @author huyulu
 * @email 1085068942@qq.com
 * @date 2021-11-28 23:13:17
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    /**
     * 添加库存
     *
     * @param skuId  添加的商品ID
     * @param wareId 放入的仓库
     * @param skuNum 放入的数量
     * @author 胡菜鸡
     * @date 2021/12/28 16:29
     */
    boolean addStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    /**
     * 根据skuId查询对应的商品是否有库存
     *
     * @author 胡菜鸡
     * @date 2021/12/31 14:20
     */
    Long selectSkuStock(Long skuId);
}
